package org.assertj.ohos.api.app;

import ohos.miscservices.screenlock.ScreenLockController;
import org.assertj.core.api.AbstractAssert;
import static org.assertj.core.api.Assertions.assertThat;

/** Assertions for {@link ScreenLockController} instances. */
public class KeyguardManagerAssert extends AbstractAssert<KeyguardManagerAssert, ScreenLockController> {
  public KeyguardManagerAssert(ScreenLockController actual) {
    super(actual, KeyguardManagerAssert.class);
  }

/* // TODO: wang, not found in ohos
  public KeyguardManagerAssert hasRestrictedInputMode() {
    isNotNull();
    assertThat(actual.inKeyguardRestrictedInputMode()) //
        .overridingErrorMessage("Expected restricted input mode but was unrestricted.") //
        .isTrue();
    return this;
  }

  public KeyguardManagerAssert hasUnrestrictedInputMode() {
    isNotNull();
    assertThat(actual.inKeyguardRestrictedInputMode()) //
        .overridingErrorMessage("Expected unrestricted input mode but was restricted.") //
        .isFalse();
    return this;
  }
*/

  public KeyguardManagerAssert hasLockedKeyguard() {
    isNotNull();
    assertThat(actual.isScreenLocked()) //
        .overridingErrorMessage("Expected locked keyguard but was unlocked.") //
        .isTrue();
    return this;
  }

  public KeyguardManagerAssert hasUnlockedKeyguard() {
    isNotNull();
    assertThat(actual.isScreenLocked()) //
        .overridingErrorMessage("Expected unlocked keyguard but was locked.") //
        .isFalse();
    return this;
  }

  public KeyguardManagerAssert hasSecureKeyguard() {
    isNotNull();
    assertThat(actual.isSecureMode()) //
        .overridingErrorMessage("Expected secure keyguard but was insecure.") //
        .isTrue();
    return this;
  }

  public KeyguardManagerAssert hasInsecureKeyguard() {
    isNotNull();
    assertThat(actual.isSecureMode()) //
        .overridingErrorMessage("Expected insecure keyguard but was secure.") //
        .isFalse();
    return this;
  }
}
